Overview of 8085 Instruction Set

The instruction set of the Intel 8085 microprocessor comprises a wide range of instructions categorized into various groups, including data transfer, arithmetic, logical, branching, and control transfer instructions. Each instruction is designed to perform a specific operation and is represented by a unique opcode.

📤

Data Transfer

Move data between registers, memory, and I/O devices

🧮

Arithmetic

Perform mathematical operations like addition and subtraction

đŸ”Ŗ

Logical

Execute logical operations like AND, OR, and XOR

🔀

Branching

Control program flow with jumps and calls

âš™ī¸

Control Transfer

Manage system operations like halt and interrupt control

📚

Stack Manipulation

Handle stack operations with push and pop

📡

Input/Output

Communicate with external devices

Data Transfer Instructions

Data transfer instructions are used to move data from one location to another within the microprocessor system. These instructions do not modify the data being transferred; they simply copy it from a source to a destination.

📋Key Instructions

🔄

MOV

Move data from one register/memory location to another

đŸ“Ĩ

MVI

Move immediate data into a register/memory location

đŸ”ĸ

LXI

Load immediate 16-bit data into a register pair

📖

LDA

Load accumulator with data from a memory address

âœī¸

STA

Store accumulator data into a memory address

🔗

LHLD & SHLD

Load and store HL register pair data from/to memory

📝Data Transfer Operations

  • Load a 8-bit number in a Register
  • Copy from Register to Register
  • Copy between Register and Memory
  • Copy between Input/Output Port and Accumulator
  • Load a 16-bit number in a Register pair
  • Copy between Register pair and Stack memory

đŸ’ģExample Data Transfer Instructions

MOV A, B
Move the contents of register B to accumulator A
MOV A, B ; A = B
MVI C, 05H
Move immediate value 05H to register C
MVI C, 05H ; C = 05H
LDA 2000H
Load accumulator with data from memory address 2000H
LDA 2000H ; A = (2000H)
STA 3000H
Store accumulator data to memory address 3000H
STA 3000H ; (3000H) = A

Arithmetic Instructions

Arithmetic instructions are used to perform mathematical operations such as addition, subtraction, increment, and decrement. These operations affect the flags in the flag register based on the result of the operation.

📋Key Instructions

➕

ADD

Add the contents of a register/memory location to the accumulator

đŸ”ĸ

ADC

Add the contents of a register/memory location to the accumulator with carry

➖

SUB

Subtract the contents of a register/memory location from the accumulator

đŸ”ģ

SBB

Subtract the contents of a register/memory location from the accumulator with borrow

âŦ†ī¸

INR

Increment the contents of a register/memory location

âŦ‡ī¸

DCR

Decrement the contents of a register/memory location

📝Arithmetic Operations

  • Addition of two 8-bit numbers
  • Subtraction of two 8-bit numbers
  • Increment/Decrement a 8-bit number

đŸ’ģExample Arithmetic Instructions

ADD B
Add the contents of register B to accumulator A
ADD B ; A = A + B
ADC C
Add the contents of register C to accumulator A with carry
ADC C ; A = A + C + CY
SUB D
Subtract the contents of register D from accumulator A
SUB D ; A = A - D
INR E
Increment the contents of register E by 1
INR E ; E = E + 1

Logical Instructions

Logical instructions are used to perform bitwise logical operations such as AND, OR, XOR, and complement. These instructions also include rotate and compare operations, which are essential for bit manipulation and decision-making in programs.

📋Key Instructions

🔗

ANA

Perform a logical AND operation between the accumulator and a register/memory location

🔄

XRA

Perform a logical XOR operation between the accumulator and a register/memory location

🔗

ORA

Perform a logical OR operation between the accumulator and a register/memory location

🔍

CMP

Compare the accumulator with a register/memory location

📝Logical & Bit Manipulation Operations

  • AND two 8-bit numbers
  • OR two 8-bit numbers
  • Exclusive-OR two 8-bit numbers
  • Compare two 8-bit numbers
  • Complement
  • Rotate Left/Right Accumulator bits

đŸ’ģExample Logical & Bit Manipulation Instructions

ANA B
Perform logical AND between accumulator A and register B
ANA B ; A = A AND B
XRA C
Perform logical XOR between accumulator A and register C
XRA C ; A = A XOR C
ORA D
Perform logical OR between accumulator A and register D
ORA D ; A = A OR D
CMP E
Compare accumulator A with register E
CMP E ; A - E (sets flags)

Branching Instructions

Branching instructions are used to alter the sequence of program execution. They include unconditional jumps, conditional jumps based on flag conditions, and subroutine calls and returns. These instructions are essential for implementing loops, conditionals, and subroutines in assembly programs.

📋Key Instructions

🔀

JMP

Unconditional jump to a specified memory address

đŸ”ĸ

JC, JNC

Jump if Carry/No Carry

đŸ”ĸ

JP, JM

Jump if Positive/Negative

đŸ”ĸ

JZ, JNZ

Jump if Zero/Not Zero

đŸ”ĸ

JPE, JPO

Jump if Parity Even/Parity Odd

📞

CALL

Call a subroutine at a specified memory address

â†Šī¸

RET

Return from a subroutine

đŸ’ģExample Branching Instructions

JMP 2000H
Unconditional jump to memory address 2000H
JMP 2000H ; PC = 2000H
JC 3000H
Jump to memory address 3000H if Carry flag is set
JC 3000H ; if CY=1, PC = 3000H
JZ 4000H
Jump to memory address 4000H if Zero flag is set
JZ 4000H ; if Z=1, PC = 4000H
CALL 5000H
Call subroutine at memory address 5000H
CALL 5000H ; Push PC, PC = 5000H
RET
Return from subroutine
RET ; Pop PC

Control Transfer Instructions

Control transfer instructions are used to manage the execution flow of the microprocessor. These instructions include operations like no operation, halt, and interrupt control, which are essential for program synchronization and system control.

📋Key Instructions

â¸ī¸

NOP

No operation (Do nothing)

âšī¸

HLT

Halt the microprocessor

đŸšĢ

DI

Disable interrupts

✅

EI

Enable interrupts

đŸ’ģExample Control Transfer Instructions

NOP
No operation - used for timing delays or placeholders
NOP ; Do nothing
HLT
Halt the microprocessor - stops execution
HLT ; Stop execution
DI
Disable interrupts - prevents interrupt handling
DI ; Disable interrupts
EI
Enable interrupts - allows interrupt handling
EI ; Enable interrupts

Stack Manipulation Instructions

Stack manipulation instructions are used to manage the stack area in memory. The stack is a Last-In-First-Out (LIFO) data structure used for storing return addresses during subroutine calls and for temporary data storage.

📋Key Instructions

âŦ‡ī¸

PUSH

Push register pairs onto the stack

âŦ†ī¸

POP

Pop register pairs from the stack

đŸ’ģExample Stack Manipulation Instructions

PUSH B
Push register pair B onto the stack
PUSH B ; Push BC register pair
PUSH D
Push register pair D onto the stack
PUSH D ; Push DE register pair
PUSH H
Push register pair H onto the stack
PUSH H ; Push HL register pair
PUSH PSW
Push processor status word (A and flags) onto the stack
PUSH PSW ; Push A and flags
POP B
Pop register pair B from the stack
POP B ; Pop BC register pair

Input/Output Instructions

Input/Output instructions are used to transfer data between the microprocessor and external devices. These instructions enable the microprocessor to communicate with peripheral devices such as keyboards, displays, and other I/O devices.

📋Key Instructions

đŸ“Ĩ

IN

Read data from an input port

📤

OUT

Write data to an output port

đŸ’ģExample Input/Output Instructions

IN 01H
Read data from input port 01H into accumulator
IN 01H ; A = Port 01H
OUT 02H
Write data from accumulator to output port 02H
OUT 02H ; Port 02H = A